package com.wfh.rpc.registry;

import com.wfh.rpc.model.RegistryConfig;
import com.wfh.rpc.model.ServiceModelInfo;

import java.util.List;

/**
 * @Title: Registry
 * @Author wangfenghuan
 * @Package com.wfh.rpc.registry
 * @Date 2025/10/14 14:05
 * @description:
 */
public interface Registry {

    /**
     * 初始化
     * @param registryConfig
     */
    void init(RegistryConfig registryConfig);

    /**
     * 注册服务
     * @param serviceModelInfo
     * @throws Exception
     */
    void register(ServiceModelInfo serviceModelInfo) throws Exception;

    /**
     * 注销服务
     * @param serviceModelInfo
     */
    void unRegister(ServiceModelInfo serviceModelInfo);

    /**
     * 服务发现
     * @param serviceKey
     * @return
     */
    List<ServiceModelInfo> serviceDiscovery(String serviceKey);

    /**
     * 服务销毁
     */
    void destory();

}
